#include<stdio.h>
#include<string.h>

struct Candidate
{
	char name[10];
	unsigned int count;
};

int main()
{
	struct Candidate ZS,LS,WW,QQ,candidate;
	ZS.count=0;
	LS.count=0;
	WW.count=0;
	QQ.count=0;
	int n;
	scanf("%d",&n);
	if (n>3&&n<=100)
	{
		while (n--)
		{
			scanf("%s",candidate.name);
			if (strcmp(candidate.name,"LS")==0)
				LS.count++;
			else if (strcmp(candidate.name,"ZS")==0)
				ZS.count++;
			else if (strcmp(candidate.name,"WW")==0)
				WW.count++;
			else
				QQ.count++;
		}
		printf("ZS:%d\n",ZS.count);
		printf("LS:%d\n",LS.count);
		printf("WW:%d\n",WW.count);
		printf("QQ:%d\n",QQ.count);
	}
	else
		puts("Input Error\n");
	return 0;
}
